home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2004 March / PCWMAR04.iso / Software / Resources / JawsPDF Creator / JawsPdfCreatorEn.exe / Disk1 / data1.cab / InstDirResource / procset / opi.ps < prev    next >
Encoding:
Text File  |  2003-08-08  |  5.2 KB  |  208 lines

  1. %!
  2. %%VMusage: 0 0
  3. %%VMlocation: global
  4. %%
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. %%                                                                  %%
  7. %% OPIProcSet: procedures to go into CommentDict to enable basic    %%
  8. %% OPI processing.                                                  %%
  9. %%                                                                  %%
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  11.  
  12.  
  13. /OPIProcSet <<
  14.  
  15. /Initialise {
  16.   userdict /OPIinitialised? known {
  17.     userdict /OPIinitialised? get
  18.   } {
  19.     false
  20.   } ifelse
  21.   not {
  22.     currentglobal false setglobal
  23.     userdict /OPIdocomment {
  24.       exch OPIdict 3 1 roll
  25.       1 index dup length string cvs anchorsearch pop pop
  26.       (: ) anchorsearch pop pop put
  27.     } put
  28.     userdict /OPIdoobject {
  29.       /OPIProcSet /ProcSet findresource begin DoObject end
  30.     } put
  31.     userdict /OPIdict 12 dict put
  32.     userdict /OPIinitialised? true put
  33.     setglobal
  34.   } if
  35. } bind
  36.  
  37. /CommentDict <<
  38.   /ALDImageFileName {/ALDImageFileName OPIdocomment}
  39.   /ALDImageID {/ALDImageID OPIdocomment}
  40.   /ALDImageDimensions {/ALDImageDimensions OPIdocomment}
  41.   /ALDImageCropRect {/ALDImageCropRect OPIdocomment}
  42.   /ALDImagePosition {/ALDImagePosition OPIdocomment}
  43.   /ALDImageColor {/ALDImageColor OPIdocomment}
  44.   /ALDImageColorType {/ALDImageColorType OPIdocomment}
  45.   /ALDImageTint {/ALDImageTint OPIdocomment}
  46.   /ALDImageTransparency {/ALDImageTransparency OPIdocomment}
  47.   /ALDImageGrayMap {/ALDImageGrayMap OPIdocomment}
  48.   /BeginObject {pop OPIdoobject}
  49. >>
  50.  
  51. /Known {
  52.   2 copy known {
  53.     1 index exch get true
  54.   } {
  55.     pop false
  56.   } ifelse
  57. } bind
  58.  
  59. %%
  60. %% OPIdict filename => OPIdict paramsdict file true
  61. %% See the manual before adding file types to this procedure.
  62. %%
  63. /FindFile {
  64.   mark {
  65.     8 dict
  66.     2 index dup 0 get 16#28 eq {cvx exec} if
  67.     (r) file 1 index /TIFFDecode filter
  68.   } stopped {
  69.     cleartomark false
  70.   } {
  71.     4 2 roll pop pop true
  72.   } ifelse
  73. } bind
  74.  
  75. %%
  76. %% OPIdict paramsdict file => -
  77. %%
  78. /DoImage {
  79.   exch begin
  80.   8 dict begin
  81.   /ImageType 1 def
  82.   /Width Width def
  83.   /Height Height def
  84.   /DataSource exch def
  85.   /BitsPerComponent BitsPerComponent def
  86.   /ImageMask false def
  87.   gsave
  88.   dup /ALDImagePosition get cvx exec
  89.   6 index sub exch 7 index sub exch
  90.   6 -2 roll
  91.   6 index sub exch 7 index sub exch
  92.   6 -2 roll pop pop
  93.   6 -2 roll matrix astore concat
  94.   0 0 1 1 rectclip
  95.  
  96.   dup /ALDImageDimensions get cvx exec
  97.   2 index /ALDImageCropRect get cvx exec
  98.   3 -1 roll sub 3 index exch div
  99.   3 1 roll exch sub 3 index exch div
  100.   exch scale
  101.   2 index /ALDImageCropRect get cvx exec
  102.   4 1 roll pop pop 3 index div neg
  103.   exch 2 index sub 2 index div
  104.   translate
  105.   pop pop
  106.  
  107.   /ALDImageOverprint Known {cvx exec setoverprint} if
  108.  
  109.   Photometric 2 lt {
  110.     /ALDImageTint Known {cvx exec} {1} ifelse /ImageTint exch def
  111.     /ALDImageGrayMap Known {
  112.       [ [ 3 -1 roll cvx exec ] /exch load 1 index length
  113.       Photometric 0 eq {1 /exch load /sub load 4 -1 roll} if
  114.       1 sub /mul load /cvi load /get load 65535 /div load] cvx settransfer
  115.     } if
  116.      /Decode [0 ImageTint Photometric 0 eq {exch} if ] def
  117. %    {
  118. %    /Decode [0 ImageTint Photometric 1 eq {exch} if ] def
  119. %    }ifelse
  120.     BitsPerComponent 1 eq {
  121.       /ALDImageTransparency Known {cvx exec} {true} ifelse
  122.       /ImageMask exch def
  123.     } if
  124.     /ALDImageColor Known {cvx exec} {0 0 0 1 (Black)} ifelse
  125.  
  126.     6 -1 roll /ALDImageColorType Known not {(Spot)} if exch 7 1 roll
  127.     dup (Separation) eq {
  128.       pop pop [/Separation /All /DeviceCMYK {dup dup dup}] setcolorspace
  129.     } {
  130.       (Process) eq {
  131.     pop
  132.     [/Indexed /DeviceCMYK 255 [ 255 /div load 11 -4 roll
  133.     systemdict /stdtinttransform get] cvx ] setcolorspace
  134.     ImageMask {
  135.       255 setcolor
  136.     } {
  137.       /Decode [0 255 ImageTint mul round cvi Photometric 0 ne {exch} if] def
  138.     } ifelse
  139.       } {
  140.     [/Separation 3 -1 roll /DeviceCMYK [ 9 -4 roll
  141.     systemdict /stdtinttransform get] cvx ] setcolorspace
  142.       } ifelse
  143.     } ifelse
  144.   } if
  145.   Photometric 2 eq {
  146.     /DeviceRGB setcolorspace
  147.     /Decode [0 1 0 1 0 1] def
  148.   } if
  149.   Photometric 3 eq {
  150.     [/Indexed /DeviceRGB Palette length 3 idiv 1 sub Palette] setcolorspace
  151.     /Decode [0 Palette length 3 idiv 1 sub] def
  152.   } if
  153.   Photometric 5 eq {
  154.     /DeviceCMYK setcolorspace
  155.     /Decode [0 1 0 1 0 1 0 1] def
  156.   } if
  157.   /ImageMatrix [Width 0 0 Height neg 0 Height] def
  158.   /ALDImageOperation Known {
  159.     cvx exec
  160.   } {
  161.     currentdict ImageMask end end
  162.     {imagemask} {image} ifelse
  163.   } ifelse
  164.   pop
  165.   grestore
  166. } bind
  167.  
  168. /DoObject {
  169.   userdict /OPIdict get
  170.   /ALDImageID Known not {
  171.     /ALDImageFileName Known pop
  172.   } if
  173.   dup type /dicttype ne  {
  174.     mark 3 1 roll
  175.     FindFile {
  176.       {
  177.     DoImage
  178.     } stopped
  179.     } {
  180.       true
  181.     } ifelse
  182.     {
  183.       (%%[ OPI substitution failed; using low resolution image ]%%) = flush
  184.     } {
  185.       1 dict begin
  186.       /junk 2048 string def
  187.       {
  188.     currentfile junk {readline} stopped {
  189.       pop pop
  190.     } {
  191.        not {stop} if
  192.        (%%EndObject) eq {exit} if
  193.     } ifelse
  194.       } loop
  195.       end
  196.     } ifelse
  197.     cleartomark
  198.   } {
  199.     pop
  200.   } ifelse
  201.   userdict /OPIdict 12 dict put
  202. } bind
  203.  
  204. >> /ProcSet defineresource
  205.  
  206. dup /Initialise get exec 
  207.  
  208.